home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6400 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.2 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What to do when feof() is NOT feof()
  5. Date: Sat, 24 Feb 96 14:53:32 GMT
  6. Organization: none
  7. Message-ID: <825173612snz@genesis.demon.co.uk>
  8. References: <4g7rsj$fnf@spectator.cris.com> <1996Feb19.063026.29889@zcon.com> <4gb7r3$p4k@sun001.spd.dsccc.com> <4gj6bg$mrv@solutions.solon.com> <312E7ACD.60CF@gate.net>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <312E7ACD.60CF@gate.net> mwa@gate.net "Mark W. Alexander" writes:
  15.  
  16. >Peter and Mike wrote stuff debating ethics, but I missed the technical details
  17. > that started it 
  18. >and have a problem that seems related to the subject...
  19. >
  20. >I'm trying to monitor a log file while a process is running by piping tail -f
  21. > into a C program 
  22. >(Solaris 2.4, if it matters). Everything works wonderfull...until...I have a
  23. > remote shell that 
  24. >passes exception information to our trouble ticketing system so that the
  25. > appriopriate (as in not 
  26. >me!) people can be awakened at unpleasent hours. Shortly, (not immediately)
  27. > after calling 
  28. >system(remote_shell_command) the third or fourth time (abitrary as far as I can
  29. > tell): feof() 
  30. >becomes true, ferror() is false, and perror() says Interrupted system call
  31. > (errno=4). In other 
  32. >words:
  33. >
  34. >        feof() != feof()
  35.  
  36. Probably something happened (like a signal being received) which, say,
  37. interrupted a read call and confused your stdio library. There's not
  38. enough evidence to prove that happened (e.g. the errno value could have
  39. been set earlier in the program e.g. during the system() call).
  40.  
  41. >My humble question is: What the ???? I can't clear the error. I can't
  42. > rewind(stdin). I can't exec 
  43. >another copy to reinitialize everything. What can I do? 
  44.  
  45. Did you try clearerr() ?
  46.  
  47. Other than that I don't think the C language can help you much - you really
  48. need a Unix/Solaris specific discussion (i.e. comp.unix.programmer).
  49.  
  50. -- 
  51. -----------------------------------------
  52. Lawrence Kirby | fred@genesis.demon.co.uk
  53. Wilts, England | 70734.126@compuserve.com
  54. -----------------------------------------
  55.